chore(lint): org-identifier authoring guard for deprecated session.tenantId (#3280 follow-up)#3289
Merged
Merged
Conversation
…n.tenantId (#3280 follow-up) `organizationId` is the blessed developer-facing name for the caller's active org in hook/action bodies (#3280); `ctx.session.tenantId` is a deprecated alias. TSDoc `@deprecated` only nudges an author whose editor surfaces it — nothing stopped our own reference apps (examples/, apps/), which authors and AIs copy from, re-introducing `session.tenantId`. scripts/check-org-identifier.mjs is a hard-fail guard (authoring surfaces carry zero occurrences today) wired into the lint workflow. Deliberately narrow: - scans author-facing reference code only (examples/, apps/) — internal packages legitimately read `session.tenantId` (driver-layer alias, a #3280 non-goal); - excludes skills/ + content/docs/, which teach the deprecated form on purpose; - matches only the `session.tenantId` token, never `execCtx.tenantId` / `opts.tenantId` / `DriverOptions.tenantId` (the generic tenancy knob); - escape hatch: `os-allow-tenant-id` comment on the line. Proven red on a new occurrence, green when reverted, suppressed by the marker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3280 (merged in #3284) and #3288. Makes the
session.tenantIddeprecation discoverable at build time for our own reference apps.Why
#3280 made
organizationIdthe blessed developer-facing name for the caller's active org in hook/action bodies;ctx.session.tenantIdis now a deprecated alias. TSDoc@deprecatedonly nudges an author whose editor surfaces it — nothing stopped our own reference apps (examples/,apps/), which authors and AIs copy from, from re-introducingsession.tenantId.What
scripts/check-org-identifier.mjs— a hard-fail guard (authoring surfaces carry zero occurrences today, so any match is new), wired into thelintworkflow next tocheck:nul-bytes/check:role-word. Deliberately narrow:examples/,apps/). Internal framework packages legitimately readsession.tenantId(the engine's ownbuildSession, the record-change trigger) — that's the driver-layer alias, a Unify the developer-facing org identifier: hooks exposesession.tenantIdwhile RLS/seed/columns useorganizationId(addorganizationIdas the blessed name) #3280 non-goal, and is not flagged.skills/+content/docs/: they deliberately show the deprecated form when teaching the deprecation.session.tenantIdtoken, neverexecCtx.tenantId/opts.tenantId/DriverOptions.tenantId(the generic driver-layer tenancy knob, explicitly out of scope).os-allow-tenant-idcomment on the line, for a genuine driver-layer use in an example.Proven red (防假绿)
ctx.session.tenantIdinto a tracked example hook → guard fails (exit 1, points toorganizationId).os-allow-tenant-id→ suppressed.check:nul-bytes); ESLint clean.Tooling-only (no package touched) → no changeset needed.
🤖 Generated with Claude Code